package com.ebuy.api.enums;


/**
 * Created by zhongr on 2017/8/25.
 */
public enum StatusEnum {
    UNACTIVE(0, "无效"), ACTIVE(1, "有效");

    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    StatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static StatusEnum getByCode(Integer code) {
        for (StatusEnum item : StatusEnum.values()) {
            if (item.getCode().equals(code)) {
                return item;
            }
        }
        return null;
    }
}
